<html>
<head><meta charset="utf-8"><title>double deallocation · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html">double deallocation</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="171955780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171955780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171955780">(Jul 29 2019 at 15:30)</a>:</h4>
<p>Any idea why transferring over the memory contents (fields of <code>Memory</code> bar the tcx) could lead to a "deallocated twice" miri eval error?</p>



<a name="171955819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171955819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171955819">(Jul 29 2019 at 15:30)</a>:</h4>
<p>transferring between different <code>InterpCx</code>s, that is</p>



<a name="171955882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171955882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171955882">(Jul 29 2019 at 15:31)</a>:</h4>
<p>the second <code>InterpCx</code> would normally eval fine, with "empty" memory</p>



<a name="171955887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171955887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171955887">(Jul 29 2019 at 15:31)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> maybe?</p>



<a name="171956497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171956497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171956497">(Jul 29 2019 at 15:38)</a>:</h4>
<p>maybe I need to remap <code>AllocId</code>s?</p>



<a name="171956886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171956886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171956886">(Jul 29 2019 at 15:41)</a>:</h4>
<p>uh... transferring things between <code>InterpCx</code> is not really supported^^</p>



<a name="171956958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171956958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171956958">(Jul 29 2019 at 15:42)</a>:</h4>
<p>"deallocated twice" means it tried to deallocate something that wasnt there, which usually can only mean it has already been deallocated before. in your case it maybe means it hasnt been copied, or so.</p>



<a name="171957955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171957955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171957955">(Jul 29 2019 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> yeah, I thought so. was trying to see if I could add support though. my solution now is very naive so... anyway, I'm just wondering why the MIR for the second <code>InterpCx</code> is even trying to access the old memory... maybe because the new <code>AllocId</code> accidentally point to it?</p>



<a name="171958377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171958377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171958377">(Jul 29 2019 at 15:57)</a>:</h4>
<p>MIR always accesses the memory of the current <code>InterpCx</code></p>



<a name="171958509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171958509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171958509">(Jul 29 2019 at 15:58)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> yeah, but I have fed the old <code>InterpCx'</code> <code>Memory</code> into the new <code>InterpCx</code>'s (tcx aside, which is fine because there are no dependencies on the tcx AFAICT)</p>



<a name="171958581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171958581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171958581">(Jul 29 2019 at 15:59)</a>:</h4>
<p>i.e. copied over the fields <code>alloc_map</code>, <code>extra_fn_ptr_map</code>, <code>dead_alloc_map</code>, <code>extra</code></p>



<a name="171958589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171958589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171958589">(Jul 29 2019 at 15:59)</a>:</h4>
<p>which is evidently too naive.</p>



<a name="171963719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171963719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171963719">(Jul 29 2019 at 16:59)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> okay... <code>AllocId</code>doesn't seem like the problem actually. I think I need to copy over <code>tcx.alloc_map</code> too.</p>



<a name="171965475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171965475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171965475">(Jul 29 2019 at 17:22)</a>:</h4>
<p>what role does <code>alloc_map</code> play exactly?is it separate from the <code>Memory</code>?</p>



<a name="171969233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/171969233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#171969233">(Jul 29 2019 at 18:03)</a>:</h4>
<p>I guess it's only for consts and statics...?</p>



<a name="172012441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172012441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172012441">(Jul 30 2019 at 07:26)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> okay... <code>AllocId</code>doesn't seem like the problem actually. I think I need to copy over <code>tcx.alloc_map</code> too.</p>
</blockquote>
<p>wait you didnt just create a new <code>InterpCx</code>, you created a new <code>tcx</code>?</p>



<a name="172012482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172012482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172012482">(Jul 30 2019 at 07:26)</a>:</h4>
<p>that's... a whole different deal.^^ would have been worth mentioning that...</p>



<a name="172012483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172012483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172012483">(Jul 30 2019 at 07:26)</a>:</h4>
<p>AFAIK literally everything in the compiler assumes there is exactly one instance of it</p>



<a name="172012513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172012513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172012513">(Jul 30 2019 at 07:27)</a>:</h4>
<p>the global <code>alloc_map</code> is where statics and consts go after they have been computed (that's "interning"). it's also where fn ptr allocations go (so that a <code>Pointer</code> can point to a function)</p>



<a name="172018013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172018013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172018013">(Jul 30 2019 at 08:51)</a>:</h4>
<p>Yea you can't just keep these in memory... you need to serialize them and "refill" them afterwards</p>



<a name="172018016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172018016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172018016">(Jul 30 2019 at 08:51)</a>:</h4>
<p>just like incremental does it</p>



<a name="172018019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172018019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172018019">(Jul 30 2019 at 08:51)</a>:</h4>
<p>otherwise all kinds of things break</p>



<a name="172018073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172018073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172018073">(Jul 30 2019 at 08:52)</a>:</h4>
<p>most notably the <code>Allocation</code> field of <code>ByRef</code> will be a dangling reference</p>



<a name="172052183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172052183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172052183">(Jul 30 2019 at 16:14)</a>:</h4>
<blockquote>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> okay... <code>AllocId</code>doesn't seem like the problem actually. I think I need to copy over <code>tcx.alloc_map</code> too.</p>
</blockquote>
<p>wait you didnt just create a new <code>InterpCx</code>, you created a new <code>tcx</code>?</p>
</blockquote>
<p>@RalfJ Ah no no, I created a new <code>InterpCx</code>... but I just copied over all over<code>Memory</code> (minus the <code>txc</code>) into the new instance of <code>InterpCxz</code>.</p>



<a name="172052210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172052210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172052210">(Jul 30 2019 at 16:14)</a>:</h4>
<blockquote>
<p>the global <code>alloc_map</code> is where statics and consts go after they have been computed (that's "interning"). it's also where fn ptr allocations go (so that a <code>Pointer</code> can point to a function)</p>
</blockquote>
<p>the tcx's <code>alloc_map</code> you mean, not <code>Memory</code>'s, right? that would make sense.</p>



<a name="172052379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172052379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172052379">(Jul 30 2019 at 16:16)</a>:</h4>
<blockquote>
<p>Yea you can't just keep these in memory... you need to serialize them and "refill" them afterwards</p>
</blockquote>
<p><span class="user-mention" data-user-id="124288">@oli</span> Yeah I kind of worried that would be the case... makes sense. Apparently incremental will already handle the restoration of statics/consts in <code>tcx.alloc_map</code>, but <code>interpret::Memory</code> I have to handle myself... is there an existing way to handle serialiasation and deserialisation of that?</p>



<a name="172053643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053643">(Jul 30 2019 at 16:32)</a>:</h4>
<p>No</p>



<a name="172053794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053794">(Jul 30 2019 at 16:35)</a>:</h4>
<p>Note that you can't just serialize the memory as deserialization will duplicate all allocations to the global alloc_map</p>



<a name="172053810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053810">(Jul 30 2019 at 16:35)</a>:</h4>
<p>Hmm</p>



<a name="172053814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053814">(Jul 30 2019 at 16:35)</a>:</h4>
<p>You literally need to do it all manually</p>



<a name="172053817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053817">(Jul 30 2019 at 16:35)</a>:</h4>
<p>right</p>



<a name="172053877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053877">(Jul 30 2019 at 16:36)</a>:</h4>
<p>Or use serde and hack something so alloc IDs get created anew during deserialization</p>



<a name="172053898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053898">(Jul 30 2019 at 16:36)</a>:</h4>
<p>But do not use rustc's serialization scheme</p>



<a name="172053903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053903">(Jul 30 2019 at 16:36)</a>:</h4>
<p>right</p>



<a name="172053927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053927">(Jul 30 2019 at 16:37)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> Not even thee serialisation infrastructure for crate metadata or whanot?</p>



<a name="172053935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053935">(Jul 30 2019 at 16:37)</a>:</h4>
<p>Hmm actually, if you don't care about memory usage that would work</p>



<a name="172053945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053945">(Jul 30 2019 at 16:37)</a>:</h4>
<p>(or incremental)</p>



<a name="172053953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053953">(Jul 30 2019 at 16:37)</a>:</h4>
<p>Iirc miri duplicates all static memory locally on write</p>



<a name="172053961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172053961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172053961">(Jul 30 2019 at 16:37)</a>:</h4>
<p>the serialisation format is inefficient eh?</p>



<a name="172054006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054006">(Jul 30 2019 at 16:38)</a>:</h4>
<p>Inefficient? No, just fine tuned to a specific use case</p>



<a name="172054013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054013">(Jul 30 2019 at 16:38)</a>:</h4>
<p>okay</p>



<a name="172054048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054048">(Jul 30 2019 at 16:39)</a>:</h4>
<p>What I mean is you can just dump all allocations via rust serialization and after deserialization don't deserialize into Memory</p>



<a name="172054080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054080">(Jul 30 2019 at 16:39)</a>:</h4>
<p>Once miri touches memory, it will fetch the allocations from the global memory when you try writing to it</p>



<a name="172054148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054148">(Jul 30 2019 at 16:40)</a>:</h4>
<p>Not sure if that works for any memory, but you can check out the copy on write scheme to see if it does what you need</p>



<a name="172054163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054163">(Jul 30 2019 at 16:40)</a>:</h4>
<p>That will duplicate any memory you modify in a single run</p>



<a name="172054168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054168">(Jul 30 2019 at 16:40)</a>:</h4>
<p>I see</p>



<a name="172054191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054191">(Jul 30 2019 at 16:40)</a>:</h4>
<p>Should be fairly minimal for a repl though, right?</p>



<a name="172054210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054210">(Jul 30 2019 at 16:41)</a>:</h4>
<p>in theory yep</p>



<a name="172054288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054288">(Jul 30 2019 at 16:42)</a>:</h4>
<p>when you say "don't deserialise into Memory"... you mean only deserialise into the gcx alloc_map?</p>



<a name="172054292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054292">(Jul 30 2019 at 16:42)</a>:</h4>
<p>and Miri handles the rest?</p>



<a name="172054662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054662">(Jul 30 2019 at 16:47)</a>:</h4>
<p>Just deserialize the alloc ids</p>



<a name="172054675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054675">(Jul 30 2019 at 16:47)</a>:</h4>
<p>Rustc does the rest</p>



<a name="172054678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054678">(Jul 30 2019 at 16:47)</a>:</h4>
<p>Oh, interesting</p>



<a name="172054751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054751">(Jul 30 2019 at 16:48)</a>:</h4>
<p>Actually</p>



<a name="172054757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054757">(Jul 30 2019 at 16:48)</a>:</h4>
<p>Ignore memory</p>



<a name="172054768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054768">(Jul 30 2019 at 16:48)</a>:</h4>
<p>Just serialize your stack</p>



<a name="172054780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054780">(Jul 30 2019 at 16:48)</a>:</h4>
<p>It contains everythjng</p>



<a name="172054995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172054995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172054995">(Jul 30 2019 at 16:51)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> what does the stack contain that I need, that Memory doesn't contain?</p>



<a name="172055300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055300">(Jul 30 2019 at 16:55)</a>:</h4>
<p>AllocIds</p>



<a name="172055317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055317">(Jul 30 2019 at 16:55)</a>:</h4>
<p>And only live ones</p>



<a name="172055344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055344">(Jul 30 2019 at 16:55)</a>:</h4>
<p>Leaked memory won't get serialized</p>



<a name="172055347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055347">(Jul 30 2019 at 16:55)</a>:</h4>
<p>as for serialising/deserialising AllocIds, isn't the issue that a) they can change between compilation sessions, b) the gcx alloc_map may not store the allocations for all miri allocs, only statics/consts, c) inc. comp. may not serialise all over the gcx alloc_map even if everything I need is there?</p>



<a name="172055359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055359">(Jul 30 2019 at 16:55)</a>:</h4>
<p>oh</p>



<a name="172055380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055380">(Jul 30 2019 at 16:55)</a>:</h4>
<p>Don't worry, the serializer knows what it's doing</p>



<a name="172055432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055432">(Jul 30 2019 at 16:56)</a>:</h4>
<p>It doesn't actually serialize alloc ids</p>



<a name="172055450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055450">(Jul 30 2019 at 16:56)</a>:</h4>
<p>It just serializes the backing allocation or function reference</p>



<a name="172055476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055476">(Jul 30 2019 at 16:56)</a>:</h4>
<p>I see</p>



<a name="172055555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055555">(Jul 30 2019 at 16:57)</a>:</h4>
<p>Excuse my ignorance... which serialiser is this? the inc. comp. one?</p>



<a name="172055626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055626">(Jul 30 2019 at 16:58)</a>:</h4>
<p>(which I guess I'd have to use independently from inc. comp.)</p>



<a name="172055645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172055645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172055645">(Jul 30 2019 at 16:58)</a>:</h4>
<p>I've done this already for types, so it should be okay</p>



<a name="172062027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172062027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172062027">(Jul 30 2019 at 18:10)</a>:</h4>
<p>^ <span class="user-mention" data-user-id="124288">@oli</span>  (in case you didn't see, sorry)</p>



<a name="172065652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172065652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172065652">(Jul 30 2019 at 18:52)</a>:</h4>
<p>Metadata or incremental, doesn't matter</p>



<a name="172065659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172065659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172065659">(Jul 30 2019 at 18:52)</a>:</h4>
<p>Both use the same logic</p>



<a name="172078424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172078424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172078424">(Jul 30 2019 at 21:33)</a>:</h4>
<p>Yeah, that was my impression too from previous high-level reading</p>



<a name="172079027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172079027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172079027">(Jul 30 2019 at 21:42)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> just serialising/deserialising the AllocIds will be a problem though, if <code>gcx.alloc_map</code> doesn't contain every miri allocation already, and that gets saved in the inc. comp. cache?</p>



<a name="172101593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172101593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172101593">(Jul 31 2019 at 06:02)</a>:</h4>
<p>Oh right</p>



<a name="172101601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172101601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172101601">(Jul 31 2019 at 06:03)</a>:</h4>
<p>Nevermind then</p>



<a name="172114878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172114878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172114878">(Jul 31 2019 at 10:15)</a>:</h4>
<blockquote>
<blockquote>
<p>the global <code>alloc_map</code> is where statics and consts go after they have been computed (that's "interning"). it's also where fn ptr allocations go (so that a <code>Pointer</code> can point to a function)</p>
</blockquote>
<p>the tcx's <code>alloc_map</code> you mean, not <code>Memory</code>'s, right? that would make sense.</p>
</blockquote>
<p>but what is the new <code>InterpCx</code>'s <code>tcx</code>? If it is not the same as the old one's that means you got two <code>tcx</code>, which means you had to create a second one of those as well^^. And that's an extremely unsupported situation, to my knowledge.</p>



<a name="172117102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172117102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172117102">(Jul 31 2019 at 10:59)</a>:</h4>
<p>If you use rustc's serialization and deserialization then everything will work out</p>



<a name="172117165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172117165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172117165">(Jul 31 2019 at 11:00)</a>:</h4>
<p>It won't serialize the tcx, and during deserialization it'll refill it with the actual one</p>



<a name="172136169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172136169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172136169">(Jul 31 2019 at 15:12)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> <span class="user-mention" data-user-id="124288">@oli</span> Yeah, I thought it was unsupported too... but what Oli says seems reassuring. So, to summarise and make sure I understood this right:<br>
1. Serialise every (relevant) <code>Allocation</code> in <code>machine.memory().alloc_map</code>, by transitively walking it (like <code>dump_allocs</code>). Use the encoding for inc. comp. / metadata.<br>
2. Serialise the <code>AllocIds</code> for live locals (or even the entire stack) using the same method as above basically.<br>
3. With the subsequent <code>InterpCx</code> &amp; tcz<code>, deserialise the above manually, making calls to </code>allocate_with` (I guess).</p>



<a name="172136175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172136175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172136175">(Jul 31 2019 at 15:12)</a>:</h4>
<p>hopefully I'm not <em>too</em> off-track.</p>



<a name="172137542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172137542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172137542">(Jul 31 2019 at 15:29)</a>:</h4>
<p>No</p>



<a name="172137557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172137557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172137557">(Jul 31 2019 at 15:29)</a>:</h4>
<p>Do not manually serialize any allocation</p>



<a name="172137575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172137575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172137575">(Jul 31 2019 at 15:29)</a>:</h4>
<p>Just serialize the stack</p>



<a name="172137697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172137697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172137697">(Jul 31 2019 at 15:30)</a>:</h4>
<p>That will serialize the live allocations</p>



<a name="172137767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172137767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172137767">(Jul 31 2019 at 15:31)</a>:</h4>
<p>But as I said earlier, check whether memory supports cow for any alloc</p>



<a name="172157179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172157179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172157179">(Jul 31 2019 at 19:20)</a>:</h4>
<blockquote>
<p>Just serialize the stack</p>
</blockquote>
<p>Not everything is <code>RustcEncodable</code> in the stack, but I could maybe make it so...?</p>



<a name="172157230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172157230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172157230">(Jul 31 2019 at 19:21)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> I wouldn't know how to check for COW to be honest...</p>



<a name="172157255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172157255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172157255">(Jul 31 2019 at 19:21)</a>:</h4>
<blockquote>
<blockquote>
<p>Just serialize the stack</p>
</blockquote>
<p>Not everything is <code>RustcEncodable</code> in the stack, but I could maybe make it so...?</p>
</blockquote>
<p>yes you'd need to do that</p>



<a name="172157322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172157322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172157322">(Jul 31 2019 at 19:22)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> I wouldn't know how to check for COW to be honest...</p>
</blockquote>
<p>check what happens when <code>get_mut</code> can't find an alloc</p>



<a name="172157400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172157400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172157400">(Jul 31 2019 at 19:23)</a>:</h4>
<p>aha</p>



<a name="172157529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172157529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172157529">(Jul 31 2019 at 19:25)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> it looks for a static (i.e. global tcx) allocation in such a case.</p>



<a name="172157640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172157640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172157640">(Jul 31 2019 at 19:27)</a>:</h4>
<p>then it should all work out</p>



<a name="172158025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172158025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172158025">(Jul 31 2019 at 19:32)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> cool. because the global tcx stores <em>all</em> miri allocations and gets serialised to incremental already, I take it?</p>



<a name="172158199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172158199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172158199">(Jul 31 2019 at 19:34)</a>:</h4>
<p>the global tcx only stores those allocations that end up in the final value of a static/const</p>



<a name="172158220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172158220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172158220">(Jul 31 2019 at 19:35)</a>:</h4>
<p>temporary allocations that were created during CTFE (when computing said initial value) are not interned into the global tcx</p>



<a name="172158429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172158429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172158429">(Jul 31 2019 at 19:37)</a>:</h4>
<p>yea, but if you serialize the stack, everything ends up in the global tcx</p>



<a name="172158476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172158476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172158476">(Jul 31 2019 at 19:37)</a>:</h4>
<p>ah, clever</p>



<a name="172158545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172158545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172158545">(Jul 31 2019 at 19:38)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> even if I'm serialising it to a separate store (not the inc. comp. cache)?</p>



<a name="172158580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172158580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172158580">(Jul 31 2019 at 19:39)</a>:</h4>
<p>yea, that doesn't change anything</p>



<a name="172158757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172158757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172158757">(Jul 31 2019 at 19:41)</a>:</h4>
<p>super. will give that a try now. hopefully implementing RustcEncodable for those types will be as simple as adding derive's. thanks for the advice!</p>



<a name="172186638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172186638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172186638">(Aug 01 2019 at 03:09)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> Ugh, does the RustcEncodable proc macro not handle default types properly? it seems to be only implementing e.g. <code>pub enum Operand&lt;Tag = (), Id = AllocId&gt;</code> for <code>Operand</code> with its default type params, not generically.</p>



<a name="172187291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172187291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172187291">(Aug 01 2019 at 03:24)</a>:</h4>
<p>I mention this to you because I saw you made at least one or two PRs to that proc macro in the past... but let me know if there's someone better to handle this. :-)</p>



<a name="172197756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172197756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172197756">(Aug 01 2019 at 07:20)</a>:</h4>
<p>I have no idea, sorry</p>



<a name="172223414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172223414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172223414">(Aug 01 2019 at 14:05)</a>:</h4>
<p>no prob</p>



<a name="172411204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411204">(Aug 03 2019 at 15:48)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> I think you worked on this feature, so... is there any diff between <code>mem::uninitialized</code> and <code>MaybeUninit::uninit().assume_init()</code> presently?</p>



<a name="172411214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411214">(Aug 03 2019 at 15:48)</a>:</h4>
<p>no, not really. both are insta-UB or at least heavily unspecified for the vast majority of types.</p>



<a name="172411222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411222">(Aug 03 2019 at 15:49)</a>:</h4>
<p>see the <code>assume_init</code> docs</p>



<a name="172411297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411297">(Aug 03 2019 at 15:50)</a>:</h4>
<p>okay ta</p>



<a name="172411311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411311">(Aug 03 2019 at 15:51)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> would you tend to prefer one or the other?</p>



<a name="172411317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411317">(Aug 03 2019 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="124069">@Alexander Regueiro</span> </p>
<div class="codehilite"><pre><span></span><span class="k">pub</span><span class="w"> </span><span class="k">unsafe</span><span class="w"> </span><span class="k">fn</span> <span class="nf">uninitialized</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="nc">T</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">MaybeUninit</span>::<span class="n">uninit</span><span class="p">().</span><span class="n">assume_init</span><span class="p">()</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="172411357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411357">(Aug 03 2019 at 15:52)</a>:</h4>
<p>literally</p>



<a name="172411358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411358">(Aug 03 2019 at 15:52)</a>:</h4>
<p>oh haha</p>



<a name="172411359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411359">(Aug 03 2019 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="124069">@Alexander Regueiro</span>  don't use <code>uninitialized</code>; it's getting deprecated</p>



<a name="172411360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411360">(Aug 03 2019 at 15:52)</a>:</h4>
<p>oh</p>



<a name="172411361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411361">(Aug 03 2019 at 15:52)</a>:</h4>
<p>I see</p>



<a name="172411364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411364">(Aug 03 2019 at 15:52)</a>:</h4>
<p>just because it's less explicit?</p>



<a name="172411372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411372">(Aug 03 2019 at 15:53)</a>:</h4>
<p>in almost all cases you want to <code>::uninit()</code> first, then do the initialization and finally <code>.assume_init()</code></p>



<a name="172411415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411415">(Aug 03 2019 at 15:54)</a>:</h4>
<p>yeah, but this is for my REPL, where I'm doing crazy stuff internally ;-)</p>



<a name="172411420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411420">(Aug 03 2019 at 15:54)</a>:</h4>
<p><code>MaybeUninit::uninit().assume_init()</code> is sound and useful more or less for <code>[MaybeUninit&lt;T&gt;; N]</code></p>



<a name="172411425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172411425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172411425">(Aug 03 2019 at 15:54)</a>:</h4>
<p>(except that case is also going away in favor of language improvements)</p>



<a name="172416803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172416803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172416803">(Aug 03 2019 at 18:43)</a>:</h4>
<blockquote>
<p>yeah, but this is for my REPL, where I'm doing crazy stuff internally ;-)</p>
</blockquote>
<p>crazy stuff is okay. Undefined Behavior is not.</p>



<a name="172416808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172416808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172416808">(Aug 03 2019 at 18:43)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="120791">RalfJ</span> would you tend to prefer one or the other?</p>
</blockquote>
<p>both should not be used. again, see the <a href="https://doc.rust-lang.org/nightly/core/mem/union.MaybeUninit.html#method.assume_init" target="_blank" title="https://doc.rust-lang.org/nightly/core/mem/union.MaybeUninit.html#method.assume_init"><code>assume_init</code> docs</a>. unless your type does not require initialziation, you might as well deref a NULL pointer -- same game.</p>



<a name="172416934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172416934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tom Phinney <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172416934">(Aug 03 2019 at 18:47)</a>:</h4>
<p>To state it more bluntly, don't give the compiler free license to scramble your program. Their are better sources of random, unpredictable behavior.</p>



<a name="172424384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172424384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172424384">(Aug 03 2019 at 22:49)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> yeah it won't be UB, because this is just to get the code to compile. when it gets interpreted, the machine will initialize the locals appropriately</p>



<a name="172441776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172441776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172441776">(Aug 04 2019 at 09:12)</a>:</h4>
<p><span class="user-mention" data-user-id="124069">@Alexander Regueiro</span>  I don't know what you mean... if that code is ever run, there is UB. or is this code you are, like, auto-generating and only running in the interpreter or so...?</p>



<a name="172456352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172456352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172456352">(Aug 04 2019 at 16:59)</a>:</h4>
<p>Exactly. Generating this automatically, and it's only ever being run in a controlled interpreter environment.</p>



<a name="172460535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172460535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172460535">(Aug 04 2019 at 19:15)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> <span class="user-mention" data-user-id="120791">@RalfJ</span> okay, so the error I get when deserialising the frame is on the line <code>let pos = self.state.data_offsets[idx] as usize;</code> in <code>AllocDecodingSession::decode_alloc_id</code></p>



<a name="172460584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172460584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172460584">(Aug 04 2019 at 19:16)</a>:</h4>
<p>kind of makes sense since <code>data_offsets</code> is initialised to an empty <code>Vec</code></p>



<a name="172467106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172467106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172467106">(Aug 04 2019 at 22:46)</a>:</h4>
<p>also, if I try to actually encode the <code>AllocId</code> like <code>CacheEncoder</code> does (using <code>specialized_encode_alloc_id</code>), then I get the panic 'no value for given alloc ID' since the ID isn't in the global tcx alloc map</p>



<a name="172467404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172467404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172467404">(Aug 04 2019 at 22:56)</a>:</h4>
<p>maybe it needs to fall back to the <code>InterpCx</code>'s <code>Memory</code> in that case somehow? hmm</p>



<a name="172598974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172598974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172598974">(Aug 06 2019 at 15:26)</a>:</h4>
<p>no ideas guys? no worries if so, I'll keep experimenting. :-)</p>



<a name="172602062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172602062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172602062">(Aug 06 2019 at 16:01)</a>:</h4>
<p>sorry this is far outside anything crazy I tried so far</p>



<a name="172602567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172602567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172602567">(Aug 06 2019 at 16:06)</a>:</h4>
<p>hah fair enoiugh.</p>



<a name="172617998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172617998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172617998">(Aug 06 2019 at 18:51)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> the issue seems to be that the global tcx <code>alloc_map</code> doesn't contain all the <code>AllocId</code>s for thee interpreter... is this right?</p>



<a name="172618005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172618005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172618005">(Aug 06 2019 at 18:51)</a>:</h4>
<p>and if so, is there any way around this?</p>



<a name="172618161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172618161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172618161">(Aug 06 2019 at 18:53)</a>:</h4>
<p>quoting myself from a few days ago:</p>
<blockquote>
<p>the global tcx only stores those allocations that end up in the final value of a static/const</p>
</blockquote>



<a name="172618247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172618247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172618247">(Aug 06 2019 at 18:54)</a>:</h4>
<blockquote>
<p>and if so, is there any way around this?</p>
</blockquote>
<p>depends. for CTFE you could hack things to just always use the global allocator. it would kill rustc memory usage but do you care?^^<br>
for Miri, the allocations in tcx have the wrong type. they cannot store Stacked Borrows state.</p>



<a name="172634685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172634685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172634685">(Aug 06 2019 at 22:37)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> aha. yeah, that's what I thought... maybe <span class="user-mention" data-user-id="124288">@oli</span>'s suggested approach won't work then. let me try to hack around it though.</p>



<a name="172634686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172634686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172634686">(Aug 06 2019 at 22:37)</a>:</h4>
<p>ta</p>



<a name="172638237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172638237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172638237">(Aug 06 2019 at 23:39)</a>:</h4>
<p>yeah... the problem with the infrastructure around <code>AllocId</code> is that it's designed to only work with tcx allocs</p>



<a name="172638244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172638244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172638244">(Aug 06 2019 at 23:39)</a>:</h4>
<p>thus only static stuff, no stacked borrows, etc.</p>



<a name="172638950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/double%20deallocation/near/172638950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/double.20deallocation.html#172638950">(Aug 06 2019 at 23:53)</a>:</h4>
<p>perhaps if I extend <code>AllocDecodingSession</code> to work with <code>interpret::Memory</code>...</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>